{% extends 'index.html' %}
{% block content %}
    {% import 'query_part.html' as query %}
    {{ query.query_part(add=url_for('kv_set'), select_arg=select_arg) }}

    <form action="{{ url_for('kv_del') }}" method="get">
        <input type="hidden" name="n" value="{{ name }}">
    <table class="table table-striped table-hover" id="data_list">
        <thead>
        <tr class="info">
            <th width="5%"><input type="checkbox" onclick="check_all(this)"></th>
            <th width="15%">key</th>
            <th width="40%">Value</th>
            <th width="20%">Value Length</th>
            <th width="10%">Action</th>
        </tr>
        </thead>
        <tbody>
        {% for item in item_list %}
            <tr>
                <td><input type="checkbox" value="{{ item.key }}" name="keys" class="cb"></td>
                <td><a href="{{ url_for('kv_get', k=item.key) }}">{{ item.key|truncate(100, True) }}</a></td>
                <td>{{ item.value|truncate(100, True) }}</td>
                <td>{{ item.value|count }}</td>
                <td>
                    <a href="{{ url_for('kv_set', k=item.key, v=item.value) }}" class="btn btn-xs btn-info"
                       title="Edit"><span class="glyphicon glyphicon-pencil"></span></a>
                    <a class="btn btn-xs btn-danger" href="{{ url_for('kv_del', k=item.key) }}" title="Remove">
                        <span class="glyphicon glyphicon-remove"></span></a>
                </td>
            </tr>
        {% endfor %}

        </tbody>

    </table>
    With selected:<button type="submit" class="btn btn-danger btn-xs"><span class="glyphicon glyphicon-remove"></span></button>
    </form>
    {% include 'pager_tabs.html' %}
{% endblock %}